#[doc = "Register `LSADC_CTRL6` reader"]
pub struct R(crate::R<LSADC_CTRL6_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<LSADC_CTRL6_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<LSADC_CTRL6_SPEC>> for R {
    fn from(reader: crate::R<LSADC_CTRL6_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Masked RX FIFO interrupt status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXMIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: The interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<RXMIS_A> for bool {
    #[inline(always)]
    fn from(variant: RXMIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rxmis` reader - Masked RX FIFO interrupt status."]
pub struct RXMIS_R(crate::FieldReader<bool, RXMIS_A>);
impl RXMIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        RXMIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXMIS_A {
        match self.bits {
            false => RXMIS_A::NO_INTERRUPT,
            true => RXMIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == RXMIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == RXMIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for RXMIS_R {
    type Target = crate::FieldReader<bool, RXMIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Masked RX overflow interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RORMIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: The interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<RORMIS_A> for bool {
    #[inline(always)]
    fn from(variant: RORMIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rormis` reader - Masked RX overflow interrupt state."]
pub struct RORMIS_R(crate::FieldReader<bool, RORMIS_A>);
impl RORMIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        RORMIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RORMIS_A {
        match self.bits {
            false => RORMIS_A::NO_INTERRUPT,
            true => RORMIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == RORMIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == RORMIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for RORMIS_R {
    type Target = crate::FieldReader<bool, RORMIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bit 1 - Masked RX FIFO interrupt status."]
    #[inline(always)]
    pub fn rxmis(&self) -> RXMIS_R {
        RXMIS_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 0 - Masked RX overflow interrupt state."]
    #[inline(always)]
    pub fn rormis(&self) -> RORMIS_R {
        RORMIS_R::new((self.bits & 0x01) != 0)
    }
}
#[doc = "LSADC_CTRL6 is the ADC masked interrupt status register.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lsadc_ctrl6](index.html) module"]
pub struct LSADC_CTRL6_SPEC;
impl crate::RegisterSpec for LSADC_CTRL6_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [lsadc_ctrl6::R](R) reader structure"]
impl crate::Readable for LSADC_CTRL6_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets LSADC_CTRL6 to value 0"]
impl crate::Resettable for LSADC_CTRL6_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
